import { AxiosPromise } from 'axios'

export interface PmProjectVO {
  projectId?: string | number
  projectName?: string
  projectCode?: string
  description?: string
  projectType?: string
  status?: string
  priority?: string
  startDate?: string
  endDate?: string
  actualStartDate?: string
  actualEndDate?: string
  progress?: number
  budget?: number
  actualCost?: number
  managerId?: string | number
  managerName?: string
  clientId?: string | number
  clientName?: string
  templateId?: string | number
  isTemplate?: boolean
  isPublic?: boolean
  createTime?: string
  remark?: string
  tasks?: PmTaskVO[]
  members?: PmProjectMemberVO[]
}

export interface PmProjectQuery extends PageQuery {
  projectName?: string
  projectCode?: string
  status?: string
  priority?: string
  managerId?: string | number
  clientId?: string | number
  isTemplate?: boolean
  isPublic?: boolean
  beginTime?: string
  endTime?: string
}

export interface PmProjectForm {
  projectId?: string | number
  projectName?: string
  projectCode?: string
  description?: string
  projectType?: string
  status?: string
  priority?: string
  startDate?: string
  endDate?: string
  actualStartDate?: string
  actualEndDate?: string
  progress?: number
  budget?: number
  actualCost?: number
  managerId?: string | number
  clientId?: string | number
  templateId?: string | number
  isTemplate?: boolean
  isPublic?: boolean
  remark?: string
}

export interface PmTaskVO {
  taskId?: string | number
  projectId?: string | number
  projectName?: string
  parentId?: string | number
  taskName?: string
  taskCode?: string
  description?: string
  taskType?: string
  status?: string
  priority?: string
  progress?: number
  startDate?: string
  endDate?: string
  actualStartDate?: string
  actualEndDate?: string
  estimatedHours?: number
  actualHours?: number
  assigneeId?: string | number
  assigneeName?: string
  reporterId?: string | number
  reporterName?: string
  sortOrder?: number
  createTime?: string
  remark?: string
  subTasks?: PmTaskVO[]
  dependencies?: PmTaskDependencyVO[]
}

export interface PmTaskQuery extends PageQuery {
  projectId?: string | number
  taskName?: string
  taskCode?: string
  status?: string
  priority?: string
  assigneeId?: string | number
  parentId?: string | number
  beginTime?: string
  endTime?: string
}

export interface PmTaskForm {
  taskId?: string | number
  projectId?: string | number
  parentId?: string | number
  taskName?: string
  taskCode?: string
  description?: string
  taskType?: string
  status?: string
  priority?: string
  progress?: number
  startDate?: string
  endDate?: string
  actualStartDate?: string
  actualEndDate?: string
  estimatedHours?: number
  actualHours?: number
  assigneeId?: string | number
  reporterId?: string | number
  sortOrder?: number
  remark?: string
}

export interface PmProjectMemberVO {
  id?: string | number
  projectId?: string | number
  userId?: number | number
  userName?: string
  nickName?: string
  avatar?: string
  deptName?: string
  role?: string
  permissions?: string
  joinDate?: string
  leaveDate?: string
  isActive?: boolean
  createTime?: string
}

export interface PmTaskDependencyVO {
  id?: string | number
  predecessorId?: string | number
  predecessorName?: string
  successorId?: string | number
  successorName?: string
  dependencyType?: string
  lagDays?: number
  createTime?: string
}

export interface PmTimeTrackingVO {
  id?: string | number
  projectId?: string | number
  projectName?: string
  taskId?: string | number
  taskName?: string
  userId?: number
  userName?: string
  startTime?: string
  endTime?: string
  duration?: number
  description?: string
  isBillable?: boolean
  hourlyRate?: number
  createTime?: string
}

export interface PmTimeStatsVO {
  totalHours?: number
  billableHours?: number
  nonBillableHours?: number
  totalCost?: number
  averageHours?: number
  startDate?: string
  endDate?: string
  recordCount?: number
}

export interface PmTeamVO {
  teamId?: string | number
  teamName?: string
  teamCode?: string
  teamDescription?: string
  teamLeaderId?: string | number
  teamLeaderName?: string
  teamStatus?: string
  teamType?: string
  parentTeamId?: string | number
  parentTeamName?: string
  sortOrder?: number
  createTime?: string
  remark?: string
}

export interface PmTeamQuery extends PageQuery {
  teamName?: string
  teamCode?: string
  teamStatus?: string
  teamType?: string
  teamLeaderId?: string | number
  parentTeamId?: string | number
}

export interface PmTeamForm {
  teamId?: string | number
  teamName?: string
  teamCode?: string
  teamDescription?: string
  teamLeaderId?: string | number
  teamStatus?: string
  teamType?: string
  parentTeamId?: string | number
  sortOrder?: number
  remark?: string
}

export interface PmTeamProjectVO {
  id?: string | number
  teamId?: string | number
  teamName?: string
  projectId?: string | number
  projectName?: string
  isPrimary?: boolean
  createTime?: string
}

export interface PmTeamProjectQuery extends PageQuery {
  teamId?: string | number
  projectId?: string | number
  isPrimary?: boolean
}

export interface PmTeamProjectForm {
  id?: string | number
  teamId?: string | number
  projectId?: string | number
  isPrimary?: boolean
}

// 项目成员相关类型定义
export interface PmProjectMemberVO {
  id?: string | number
  memberId?: string | number
  projectId?: string | number
  projectName?: string
  userId?: number | number
  userName?: string
  nickName?: string
  roleId?: string | number
  role?: string
  roleName?: string
  permissions?: string
  joinDate?: string
  leaveDate?: string
  isActive?: boolean
  status?: string
  remark?: string
  createTime?: string
  updateTime?: string
}

export interface PmProjectMemberQuery extends PageQuery {
  projectId?: string | number
  userId?: number | number
  role?: string
  roleId?: string | number
  isActive?: boolean
  beginJoinDate?: string
  endJoinDate?: string
}

export interface PmProjectMemberForm {
  id?: string | number
  memberId?: string | number
  projectId?: string | number
  userId?: number | number
  roleId?: string | number
  role?: string
  permissions?: string
  joinDate?: string
  leaveDate?: string
  isActive?: boolean
  status?: string
  remark?: string
}

// 团队项目关联相关类型
export interface PmTeamProjectVO {
  id?: string | number
  teamId?: string | number
  projectId?: string | number
  isPrimary?: boolean
  teamName?: string
  projectName?: string
  createTime?: string
  updateTime?: string
}

export interface PmTeamProjectQuery extends PageQuery {
  teamId?: string | number
  projectId?: string | number
  isPrimary?: boolean
  beginTime?: string
  endTime?: string
}

export interface PmTeamProjectForm {
  id?: string | number
  teamId?: string | number
  projectId?: string | number
  isPrimary?: boolean
}

// 分页查询参数
export interface PageQuery {
  pageNum?: number
  pageSize?: number
  orderByColumn?: string
  isAsc?: string
  [key: string]: any
}
